package com.mayikt.thread;

/**
 * @ClassName Thread002
 * @Author 蚂蚁课堂余胜军 QQ644064779 www.mayikt.com
 * @Version V1.0
 **/
public class Thread002 implements Runnable {
    @Override
    public void run() {

        System.out.println(Thread.currentThread().getName() + ",我是子线程");
        try {
            Thread.sleep(3000);
        } catch (Exception e) {

        }
    }

    public static void main(String[] args) {
        new Thread(new Thread002()).start();
        System.out.println("mayikt");
//        new Thread(new Runnable() {
//            @Override
//            public void run() {
//                System.out.println(Thread.currentThread().getName() + ",我是子线程");
//            }
//        }).start();
//        new Thread(() -> System.out.println(Thread.currentThread().getName() + ",我是子线程")).start();

        /**
         * 因为在绝大多数的情况下 异步是不需要返回结果
         */
        /*
        Callable
         */

    }
}
